﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace WebFormsBinder.ControlWrappers
{
    public class BoolCheckBox : IControlWrapper<bool, CheckBox>
    {
        public bool GetValue(CheckBox control)
        {
            return control.Checked;
        }

        public void SetValue(CheckBox control, bool value)
        {
            control.Checked = value;
        }

        public string JSValue(CheckBox checkbox)
        {
            return string.Format("document.getElementById('{0}').checked", checkbox.ClientID);
        }

        public string JSTypeValidationCondition(CheckBox control)
        {
            return null;
        }

        public string JSElement(CheckBox control)
        {
            return string.Format("document.getElementById('{0}')", control.ClientID);
        }
    }
}
